home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Phreaking⁄Wardialers / Utilities / ESNWizz / ESN Wizz.txt < prev   
Text File  |  1995-08-19  |  2KB  |  31 lines

  1. ESN Wizz V2.0
  2. by Kaos
  3. This util was coded with Code Warrior Gold by Kaos of The Network.
  4. The conversion information was supplied by Ian Vader & Mind Games, who without that help this program would not have been possible!!
  5. For all dudes using this util, that wish to write a simular util for another platform (or maybe ya just think this sucks!), heres the info ya need. All info in black is taken from a original posting by Ian Vader to me, my programming comments are in red.
  6.  
  7. The number is in HEX in this format;            XXXXXXXX
  8.  
  9. You split the number down the middle;              XXXX  XXXX
  10.  
  11. The 1st 4 Hex digits make the last 5 decimal digits of the 11 digit decimal No.
  12.  
  13. Hex digit number five ( ie.     XXXX  X  XXX ) in decimal is digits 5 & 6 .
  14.  
  15. The last 3 Hex digits  ( ie.     XXXXX  XXX ) are converted to binary. -
  16.  
  17. This gives a 12 digit binary number which is split down the middle.
  18. Make two copies of this number (that is the 3 last hex digits), then bit clear the last 26 unused bits of the first copy - this gives us digits 3 & 4. Now take the second copy (totally unmodified by the last operation!!!!) and rotate the bits 6 places to the left, now bit clear the last 26 bits again - this gives us digits 1 & 2 . Piece a cake!! clearing the bits in this way is the same as turning the hex number to binary and using the 6 bits in the manner listed above. If ya cant see why doing this works then ya really shouldn't be attempting to write the util!!
  19.  
  20. The 1st  6 digits binary are converted to decimal to give digits 3 & 4 decimal.
  21.  
  22. The last 6 digits binary are converted to decimal to give digits 1 & 2 decimal.
  23.  
  24. That is then your   11 digit decimal number from the 8 digit Hex.  Remember if you get any number not say 2 digits ie 00 normally on digits 5 and 6 decimal just put the zero in front.
  25.  
  26. Kaos
  27. kaos@phreak.intermedia.co.uk
  28.  
  29. Programming history.
  30. Version1.5 - Added the ability to convert ESN's from a file.
  31. Version 2.0 - Found a bug !!! eek wot a good one too!! - It turned out that the 8 bytes of storage space I allocated for the HEX ESN was not disposed of if the contents turned out to be an invalid ESN. This meant running the util on a large file that had lots of invalid data would cause the heap to overflow. Wow MacSbug time and mega hang-up, even poor MacsBug could not help me out, and many a re-boot followed. arggghhh the joys of programming ;-)